﻿<UserControl x:Class="MyPoints.UserControls.SelectFile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MyPoints.UserControls.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="24" d:DesignWidth="300"
             x:Name="parent">
  <UserControl.Resources>
    <local:PathExistToSolidBrushConverter x:Key="PathToBrushConverter" />
  </UserControl.Resources>
    <DockPanel LastChildFill="True" DataContext="{Binding ElementName=parent}">
      <Button DockPanel.Dock="Right" x:Name="btnBrowse" Content=" (...) " Click="btnBrowse_Click" />
    <TextBox x:Name="txtText" Text="{Binding Selected, UpdateSourceTrigger=PropertyChanged, Delay=100}">
      <TextBox.Background>
        <MultiBinding Converter="{StaticResource ResourceKey=PathToBrushConverter}">
          <Binding Path="Selected" />
          <Binding Path="Mode" />
        </MultiBinding>
      </TextBox.Background>
    </TextBox>
  </DockPanel>
</UserControl>
